home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Macro assembler dev syst.adf / include / exec / libraries.i < prev    next >
Text File  |  1985-12-20  |  3KB  |  126 lines

  1.     IFND EXEC_LIBRARIES_I
  2. EXEC_LIBRARIES_I SET 1
  3. **********************************************************************
  4. *
  5. * Commodore-Amiga, Inc. -- ROM Operating System Executive Include File
  6. *
  7. **********************************************************************
  8. *
  9. *   Source Control:
  10. *
  11. *  $Header: libraries.i,v 1.0 85/08/28 15:11:09 carl Exp $
  12. *
  13. *  $Locker:  $
  14. *
  15. **********************************************************************
  16.  
  17.     IFND EXEC_NODES_I
  18.     INCLUDE "exec/nodes.i"
  19.     ENDC !EXEC_NODES_I
  20.  
  21.  
  22. *------ Special Constants ---------------------------------------
  23.  
  24. LIB_VECTSIZE   EQU   6
  25. LIB_RESERVED   EQU   4
  26. LIB_BASE       EQU   $FFFFFFFA   * (-LIB_VECTSIZE)
  27. LIB_USERDEF    EQU   LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE)
  28. LIB_NONSTD     EQU   LIB_USERDEF
  29.  
  30. *----------------------------------------------------------------
  31. *
  32. *   Library Definition Macros
  33. *
  34. *----------------------------------------------------------------
  35.  
  36. *------ LIBINIT sets base offset for library function definitions:
  37.  
  38. LIBINIT     MACRO   * [baseOffset]
  39.          IFC       '\1',''
  40. COUNT_LIB   SET     LIB_USERDEF
  41.             ENDC
  42.          IFNC    '\1',''
  43. COUNT_LIB   SET       \1
  44.          ENDC
  45.             ENDM
  46.  
  47.  
  48. *------ LIBDEF is used to define each library function entry:
  49.  
  50. LIBDEF      MACRO   * libraryFunctionSymbol
  51. \1          EQU     COUNT_LIB
  52. COUNT_LIB   SET     COUNT_LIB-LIB_VECTSIZE
  53.             ENDM
  54.  
  55.  
  56. *----------------------------------------------------------------
  57. *
  58. *   Standard Library Functions
  59. *
  60. *----------------------------------------------------------------
  61.  
  62.     LIBINIT LIB_BASE
  63.  
  64.     LIBDEF  LIB_OPEN
  65.     LIBDEF  LIB_CLOSE
  66.     LIBDEF  LIB_EXPUNGE
  67.     LIBDEF  LIB_EXTFUNC       * reserved *
  68.  
  69.  
  70. *----------------------------------------------------------------
  71. *
  72. *   Standard Library Data Structure
  73. *
  74. *----------------------------------------------------------------
  75.  
  76.  STRUCTURE LIB,LN_SIZE
  77.     UBYTE   LIB_FLAGS
  78.     UBYTE   LIB_pad
  79.     UWORD   LIB_NEGSIZE                 * number of bytes before LIB
  80.     UWORD   LIB_POSSIZE                 * number of bytes after LIB
  81.     UWORD   LIB_VERSION                 * major
  82.     UWORD   LIB_REVISION                * minor
  83.     APTR    LIB_IDSTRING                * identification
  84.     ULONG   LIB_SUM                     * the checksum itself
  85.     UWORD   LIB_OPENCNT                 * number of current opens
  86.     LABEL   LIB_SIZE
  87.  
  88.  
  89. *------ LIB_FLAGS bit definitions:
  90.  
  91.     BITDEF  LIB,SUMMING,0               * we are currently checksumming
  92.     BITDEF  LIB,CHANGED,1               * we have just changed the lib
  93.     BITDEF  LIB,SUMUSED,2               * set if we should bother to sum
  94.     BITDEF  LIB,DELEXP,3                * delayed expunge
  95.  
  96.  
  97. *----------------------------------------------------------------
  98. *
  99. *   Function Invocation Macros
  100. *
  101. *----------------------------------------------------------------
  102.  
  103. *------ CALLLIB for calling functions where A6 is already correct:
  104.  
  105. CALLLIB     MACRO   * functionOffset
  106.    IFGT NARG-1
  107.        FAIL    !!! CALLLIB MACRO - too many arguments !!!
  108.    ENDC
  109.             JSR     \1(A6)
  110.             ENDM
  111.  
  112.  
  113. *------ LINKLIB for calling functions where A6 is incorrect:
  114.  
  115. LINKLIB     MACRO   * functionOffset,libraryBase
  116.    IFGT NARG-2
  117.        FAIL    !!! LINKLIB MACRO - too many arguments !!!
  118.    ENDC
  119.             MOVE.L  A6,-(SP)
  120.             MOVE.L  \2,A6
  121.             CALLLIB \1
  122.             MOVE.L  (SP)+,A6
  123.             ENDM
  124.  
  125.     ENDC !EXEC_LIBRARIES_I
  126.